package com.fengmi.security;

import com.fengmi.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.nio.file.AccessDeniedException;

@ControllerAdvice//控制器通知  做全局异常处理
public class CustomerAccessExceptionResolver {

    @ExceptionHandler(AccessDeniedException.class)//指定对哪个异常进行处理
    @ResponseBody
    private ResultVO handler(){
        return new ResultVO(false, "没有权限访问", "403");
    }
}
